package com.hellpro.lolbox.video.view;

import android.content.Context;
import android.os.Bundle;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;

import com.hellpro.lolbox.R;
import com.hellpro.lolbox.base.LolBaseActivity;
import com.hellpro.lolbox.video.presenter.VideoSearchPresenter;
import com.hellpro.lolbox.video.view.fragment.IVideoSearchActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class VideoSearchActivity extends LolBaseActivity implements IVideoSearchActivity {


    @BindView(R.id.video_search_toolbar)
    Toolbar videoSearchToolbar;
    @BindView(R.id.video_search_et_inPut)
    EditText videoSearchEtInPut;
    @BindView(R.id.video_search_btn)
    Button videoSearchBtn;
    @BindView(R.id.video_search_lv)
    ListView videoSearchLv;
    private VideoSearchPresenter presenter;

    @Override
    public int getLayoutId() {
        return R.layout.activity_video_search;
    }

    @Override
    public void initView() {
        presenter = new VideoSearchPresenter(this);
       videoSearchToolbar.setNavigationOnClickListener(new View.OnClickListener() {
           @Override
           public void onClick(View v) {
               finish();
           }
       });
    }

    @Override
    public Toolbar getSearchToolbar() {
        return videoSearchToolbar;
    }

    @Override
    public EditText getEtInput() {
        return videoSearchEtInPut;
    }

    @Override
    public Button getBtnSearch() {
        return videoSearchBtn;
    }

    @Override
    public Context getSearchContext() {
        return VideoSearchActivity.this;
    }

    @Override
    public ListView getSearchLv() {
        return videoSearchLv;
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        // TODO: add setContentView(...) invocation
        ButterKnife.bind(this);
    }

    @OnClick(R.id.video_search_btn)
    public void onClick() {
        presenter.setSearch();
    }
}
